package com.buka.communicate.adapter;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.buka.communicate.R;
import com.buka.communicate.activity.GiftDetailActivity;
import com.buka.communicate.entity.User;

import net.neiquan.applibrary.base.MyBaseAdapter;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * 作者 ： dyj
 * 时间 ： 2016/12/29.
 */

public class GiftFuBowAdapter extends MyBaseAdapter<User, GiftFuBowAdapter.ViewHolder> {

    public GiftFuBowAdapter(Activity context, List data) {
        super(context, data);
    }

    @Override
    public int getItemCount() {
        return 11;
    }

    @Override
    protected ViewHolder getViewHolder() {
        return new ViewHolder(mInflater.inflate(R.layout.item_gift_fubow, null));
    }

    @Override
    protected void onBindViewHolder_(final ViewHolder holder, int position) {
        holder.giftChooseFL.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                holder.giftChooseFL.setBackground(context.getResources().getDrawable(R.drawable.shape_wrap_line_app_color));
                holder.giftChosen.setVisibility(View.VISIBLE);
                context.startActivity(new Intent(context, GiftDetailActivity.class));
            }
        });
    }


    static class ViewHolder extends RecyclerView.ViewHolder {
        @InjectView(R.id.giftName)
        TextView giftName;
        @InjectView(R.id.giftExprience)
        TextView giftExprience;
        @InjectView(R.id.giftBeautfy)
        TextView giftBeautfy;
        @InjectView(R.id.giftBeautfyAdd)
        TextView giftBeautfyAdd;
        @InjectView(R.id.costLogo)
        ImageView costLogo;
        @InjectView(R.id.costNum)
        TextView costNum;
        @InjectView(R.id.giftImg)
        ImageView giftImg;
        @InjectView(R.id.giftLogo)
        ImageView giftLogo;
        @InjectView(R.id.giftChosen)
        ImageView giftChosen;
        @InjectView(R.id.giftChooseFL)
        FrameLayout giftChooseFL;
        ViewHolder(View view) {
            super(view);
            ButterKnife.inject(this, view);
        }
    }
}
